package com.iris.live.services.data.repositories.impl;

import com.google.common.collect.Maps;
import com.iris.live.services.data.repositories.RoleItemSqlRepository;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;
import java.util.Map;

/**
 * Created by yitianle on 2017/10/23.
 */
@Repository
@Transactional//(readOnly = true)
public class RoleItemSqlRepositoryImpl extends BaseRepository implements RoleItemSqlRepository {

    @Override
    public List getFunctionListByRoleId(Integer roleId) {
        String sql = "select f.itemName as 功能名称 \n" +
                " from roleitem  as r \n" +
                " left join iteminfo  as f ON r.itemId = f.id \n" +
                " where r.roleId in("+ roleId +") ";
        Map params = Maps.newHashMap();
        return this.getList(sql, params);
    }
}
